<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    <h:form>
        <p:commandButton value="REGRESAR AL LISTADO DE PROVEEDORES" update=":panelContent">
            <f:setPropertyActionListener
                target="#{navigationController.navigationContent}"
                value="./pages/administration/provider_view.xhtml" />
        </p:commandButton>
    </h:form>
    <hr/>
    <h:form>
        <h1><h:outputText value="Create/Edit"/></h1>
        <p:panelGrid columns="2">
            <p:outputLabel value="Name:" for="name" />
            <p:inputText id="name" value="#{providerController.provider.name}" title="Name" required="true"/>
            <p:outputLabel value="Ruc:" for="ruc" />
            <p:inputText id="ruc" value="#{providerController.provider.ruc}" title="Ruc" />
            <p:outputLabel value="Contact:" for="contact" />
            <p:inputText id="contact" value="#{providerController.provider.contact}" title="Contact" />
            <p:outputLabel value="Phone:" for="phone" />
            <p:inputText id="phone" value="#{providerController.provider.phone}" title="Phone" />
            <p:outputLabel value="Email:" for="email" />
            <p:inputText id="email" value="#{providerController.provider.email}" title="Email" />
            <p:outputLabel value="Address:" for="address" />
            <p:inputText id="address" value="#{providerController.provider.address}" title="Address" />
        </p:panelGrid>
        <hr/>
        <p:commandButton value="Guardar datos" update="@form"
                         action="#{providerController.saveOrUpdateProvider()}"/>
    </h:form>


</ui:composition>
